package cn.message.service.impl;

import cn.itcast.mapper.permissionMapper;
import cn.itcast.pojo.permission;
import cn.itcast.pojo.permissionExample;
import cn.message.service.IPermissionService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @author 郭智超
 * @create 2020-04-27 9:53
 */
@Service
public class PermissionServiceImpl implements IPermissionService {

    @Resource
    private permissionMapper permissionMapper;
    /**
     * 根据管理员所有的管理员id查询该管理员所拥有的的权限
     * @param roleIds
     * @return
     */
    @Override
    public List<permission> getPermissionByRoleIds(List<Integer> roleIds) {

        return permissionMapper.getPermissionByRoleIds(roleIds);
    }

    @Override
    public List<permission> getPermissions() {
        permissionExample permissionExample = new permissionExample();
        List<permission> permissionList = permissionMapper.selectByExample(permissionExample);
        return permissionList;
    }


}
